<?php
	class baseControl extends Control{
		function login(){
			C("debug",0);
			$this->display();
		}
		function reg_login(){
			//p($_POST);exit;
			$_SESSION['username']=$_POST['username'];
			$username=$_POST['username'];
			$db=M("user");
			$row=$db->where("username='$username'")->find();
			$_SESSION['uid']=$row['uid'];
			if(!$this->rbac_user_login($_POST['username'],md5($_POST['password']),'admin')){
				$this->error($this->error);
			}else{
				$this->go("index/index");
			}
		}
		function out(){
			$_SESSION=array();
			session_destroy();
			//$this->success("您已经成功退出");
			$this->go("login");
		}
	}
?>